Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python: colocate sitecustomize with python derivation output #377

Closed
wants to merge 1 commit into from

Conversation

cdmistman
Copy link
Contributor

Why

pylint makes some assumptions about the format of PYTHONPATH 🙄

What changed

changed the python wrapper to use the output of a new derivation that:

  1. copies the provided python derivation output
  2. removes its sitecustomize.py if it exists
  3. copies in our own sitecustomize.py

Test plan

python template tests pass

Rollout

Describe any procedures or requirements needed to roll this out safely (or check the box below)

  • This is fully backward and forward compatible

@cdmistman cdmistman requested a review from a team as a code owner July 24, 2024 00:55
@cdmistman cdmistman requested review from airportyh and removed request for a team July 24, 2024 00:55
@@ -100,6 +99,14 @@ let

sitecustomize = pkgs.callPackage ./sitecustomize.nix { };

sitecustomized-python = pkgs.runCommand "python-replit-sitecustomized" {} ''
ls -al ${python.outPath}
${pkgs.rsync}/bin/rsync -av --chown=$USER --chmod=+w ${python.outPath}/ $out/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am baffled that this is the only way. Doesn't this double the disk required for all python packages?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ooooh i think you're right, i don't actually force this python's usage anywhere. i'll fix that in the morning

@airportyh
Copy link
Collaborator

As mentioned in your one-on-one chat. I'd like to abandon making changes to python and patch the repo unless we get more data points that this is a widespread problem.

@cdmistman cdmistman closed this Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants